package org.example.study2;

import java.io.FileOutputStream;
import java.io.IOException;

public class Demo_203 {
    public static void main(String[] args) throws IOException {
        // 通过文件路径创建一个输出流
        FileOutputStream outputStream = new FileOutputStream("D:\\temp\\java114\\output_stream.txt");
        // 写入内容到文件，以字节的形式写入文件
        outputStream.write(97);  // a
        outputStream.write(98);  // b
        outputStream.write(99);  // c
        outputStream.write(13);
        outputStream.write(10);
        outputStream.write(-26);
        outputStream.write(-120);
        outputStream.write(-111);
        outputStream.write('\n');

        // 刷新一下缓冲区
        outputStream.flush();
        // 关闭流
        outputStream.close();
    }
}
